package com.example.springLearning.part7.service;

import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;

@Service
public class Fixed3ElectricService {

    public void charge() throws Exception {
        System.out.println("Electric charging ...");
        Fixed3ElectricService fixed3ElectricService = (Fixed3ElectricService) AopContext.currentProxy();
        fixed3ElectricService.pay();
    }

    public void pay() throws Exception {
        System.out.println("Pay with alipay ...");
        Thread.sleep(1000);
    }
}
